<?php

/**
 * Created by PhpStorm.
 * User: Administrator
 * Date: 2019\6\15 0015
 * Time: 16:56
 */
namespace BigVideo\IMooc\Evrnt;

abstract class EventGenerator
{
    private $observers = [];

    /**
     * @param Observer $observer
     */
    public function addObserver(Observer $observer){
        $this->observers[] = $observer;
    }

    public function notify(){
        /** @var Observer $observer */
        foreach ($this->observers as $observer) {
            $observer->update();
        }
    }

}














